home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / demos / robust / rob.dem < prev   
Text File  |  1999-09-16  |  522b  |  45 lines

  1. s=poly(0,'s');
  2.  
  3. //MAC-FARLANE PROBLEM for G=1/s^3;
  4.  
  5. [P,r]=macglov(1/s^3);
  6. clean(P)
  7.  
  8. //Optimal controller K:
  9.  
  10. halt()
  11. [K,ro]=h_inf(P,r,0,1,30);
  12.  
  13. K    //Optimal controller , ro = gamaopt^-2;
  14.  
  15. gamaopt=1/sqrt(ro)
  16.  
  17. // Check internal stability:
  18.  
  19. halt()
  20.  
  21. Tzw=lft(tf2ss(P),tf2ss(K));
  22.  
  23. [Acl,Bcl,Ccl,Dcl]=abcd(Tzw); spec(Acl)
  24.  
  25. //Optimal gain:
  26.  
  27. halt()
  28.  
  29. ga=h_norm(Tzw)
  30.  
  31. //Compare with gamaopt
  32.  
  33. ga-gamaopt
  34.  
  35. //Compare with theory
  36.  
  37. halt()
  38.  
  39. [N,M]=lcf(tf2ss(1/s^3)); //Left coprime factorization of G.
  40.  
  41. nk=hankelsv([N,M]);
  42.  
  43. ro-( 1-nk(1) )
  44.  
  45.